<?php if($this->session->flashdata('message') != "" && $this->session->flashdata('message_type') != ""): ?>
    <?php if($this->session->flashdata('message_type') == "1"): ?>
        <div class="alert alert-success">
            <i class="fa fa-check-circle"></i> <?php echo $this->session->flashdata('message'); ?>
        </div>
    <?php elseif($this->session->flashdata('message_type') == "0"): ?>
        <div class="alert alert-danger">
            <i class="fa fa-exclamation-triangle"></i> <?php echo $this->session->flashdata('message'); ?>
        </div>
    <?php endif; ?>
<?php endif; ?>
<div class="bs-example bs-example-tabs">
    <ul id="myTab" class="nav nav-tabs">
        <li class="active"><a href="#tab1" data-toggle="tab"><i class="fa fa-map-marker"></i> Location Lists</a></li>
        <li><a href="#tab2" data-toggle="tab"><i class="fa fa-plus-square"></i> Add Location</a></li>
    </ul>
    <div id="myTabContent" class="tab-content">
        <div class="tab-pane fade in active" id="tab1">
            <table class="table table-bordered table-striped table-hover">
                <tr>
                    <th width="5%">ID</th>
                    <th>Location Name</th>
                    <th>Latitude</th>
                    <th>Longitude</th>
                    <th width="10%">Added By</th>
                    <th width="15%">Actions</th>
                </tr>
                <?php foreach($pager as $data): ?>
                <tr>
                    <td><?php  echo $data['id_location'] ?></td>
                    <td>
                        <a href="<?php echo site_url("Home/search/$data[location_name]") ?>" target="_blank">
                            <?php  echo $data['location_name'] ?>
                        </a>
                    </td>
                    <td><?php  echo $data['global_latitude'] ?></td>
                    <td><?php  echo $data['global_longitude'] ?></td>
                    <td><?php  echo $data['username_admin'] ?></td>
                    <td align="center">
                        <a href="<?php echo site_url("Admin/edit_location/$data[id_location]") ?>" class="btn btn-xs btn-warning"><i class="fa fa-eraser"></i> Edit</a>
                        <a href="<?php echo site_url("Admin/delete_location/$data[id_location]") ?>" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> Delete</a>
                    </td>
                </tr>
                <?php endforeach; ?>
            </table>
            <div style="width:100%;overflow:hidden;">
                <?php echo $halaman; ?>    
            </div>
        </div>
        <div class="tab-pane fade" id="tab2">
            <?php $this->load->view('admin/includes/sub/loc_add') ?>
          
        </div>
    </div>
</div>
